package com.woniu.repaircenter.models.form;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.math.BigDecimal;

@Data
@ApiModel("修改材料信息参数")
public class UpdateMaterialForm {
    @NotBlank(message = "材料编号不能为空")
    @Size(min = 1, max = 10, message = "材料编号长度必须在1到10之间")
    @ApiModelProperty("材料编号")
    private String materialCode;
    @Size(min = 1, max = 20, message = "材料全称长度必须在1到10之间")
    @ApiModelProperty("材料全称")
    private String materialAllName;
    @Size(min = 1, max = 10, message = "材料简称长度必须在1到10之间")
    @ApiModelProperty("材料简称")
    private String materialName;
    @Size(min = 1, max = 10, message = "规格型号长度必须在1到10之间")
    @ApiModelProperty("规格型号")
    private String specType;
    @Size(min = 1, max = 10, message = "计量单位长度必须在1到10之间")
    @ApiModelProperty("计量单位")
    private String meteringUnit;
    @Positive(message = "库存数量必须为正数")
    @Max(value = 10000, message = "库存数量必须在1到10之间")
    @ApiModelProperty("库存数量")
    private Integer inventory;
    @ApiModelProperty("备注")
    @Size(min = 1, max = 50, message = "备注长度必须在1到10之间")
    private String remark;
    @Positive(message = "金额必须为正数")
    @DecimalMax(value = "1000000", message = "金额必须在1到10之间")
    @ApiModelProperty("金额")
    private BigDecimal amount;
}
